	<!--header-->
    <!--dingbu-->
    <div class="d_top">
		<div class="d_top_z">
			<div class="d_top_1">
			<a href="{:U('Index/index')}">首页</a>
			</div>
            <php>
                if($_SESSION['user_name']){
            </php>
			<div class="d_top_2">
			<a href="{:U('Index/grwb')}">个人中心</a>
			</div>
            <php>       
                }else{  
                }
            </php>
			<div class="d_top_2">
			<a href="{:U('Index/rmpd')}">热门频道</a>
			</div>		
			<div class="d_top_4">
				<form action="{:U('Index/search')}" method="post">
					<input type="image" src="__PUBLIC__/img/d_top_sou.jpg" class="d_top_4_sou"/>
					<a onclick="qingkongsousuolan()"><input name="sousuoci" class="d_top_4_sou_input" value="搜名字/广播" id="sousuolanzi" style="text-indent:5px;"/></a>
				</form>
 <script>
 function qingkongsousuolan(){
	 if($('#sousuolanzi').val()=="搜名字/广播"){
		 var zi="";
	     $('#sousuolanzi').val(zi);
	 }
		
 }  
 </script>
			</div>
			<div class="d_top_5" style="overflow:hidden;">
			
            <php>
                if($_SESSION['user_name']){
            </php>
            	 <a href="{:U('Index/fksy',array(quid=>$_SESSION[user_id]))}" style="color:#fff;"><php>echo $_SESSION['nicheng'];</php></a>
                 <a href="{:U('User/logout')}" style="color:#ccc;float:right;">退出</a>
            <php>
                }else{
            </php>
            	 [ <span class="dengluyangshi"><a href="javascript:;" onclick="fir_adda()">登录</a></span> | <span class="dengluyangshi"><a href="javascript:;" onclick="fir_add()">注册</a></span> ]
            <php>
                }
            </php>
			</div>
			<div class="d_top_6">

				<div class="d_top_6_tu">
                <php>
                    if($_SESSION['user_name']){
                </php>
				<a title="发微博" href="{:U('Index/grwbsy')}"><img src="__PUBLIC__/img/xwb.png" width="24" height="22" /></a>
                <php>       
                    }else{    
                    }
         	   </php>
				</div>
				<div class="d_top_6_tu">
                <php>
                    if($_SESSION['user_name']){
                </php>
				<a title="发私信" href="{:U('Index/pcxx')}"><img src="__PUBLIC__/img/xx.png" width="24" height="22" /></a>
                <php>       
                    }else{    
                    }
         	   </php>
				</div>
				<div class="d_top_6_tu">
                <php>
                    if($_SESSION['user_name']){
                </php>
				<a title="设置" href="{:U('Index/grsz')}"><img src="__PUBLIC__/img/sz.png" width="24" height="22" /></a>
                <php>       
                    }else{    
                    }
         	   </php>
				</div>

				<div class="d_top_6_tu">
				<script language="javascript"> 
                function show_Favorite(sURL, 
                sTitle){   sURL = 
                encodeURI(sURL);try{window.external.addFavorite(sURL, 
                sTitle);}catch(e) 
                {try{window.sidebar.addPanel(sTitle, sURL, "");}catch 
                (e) 
                {alert("加入收藏失败，请使用Ctrl+D进行添加,或手动在浏览器里进行设置.");}}
                
                }
                function 
                showList(id,num){if(num==1){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}
				function 
                show_index(url){
                
                      if (document.all) 
                {document.body.style.behavior='url(#default#homepage)';document.body.setHomePage(url);}else{
                
                alert("您好,您的浏览器不支持自动设置页面为首页功能,请您手动在浏览器里设置该页面为首页!");}
                
                }
                
                </script>
				<a title="设为首页" onclick="show_index(window.location);" href="javascript:;"><img src="__PUBLIC__/img/swsy.png" width="24" height="22" /></a>
				</div>
			</div>
	     <div class="clear"></div>
		</div>	
    </div>
    
<script>
function fir_add(){

	ui.box.tad('#tt',{title:'注册'}); //弹出id为first_edit的div,并且标题为:name
}
function fir_addg(){
	ui.box.close();
}
function fir_adda(){

	ui.box.tad('#tta',{title:'登录'}); //弹出id为first_edit的div,并且标题为:name
}
function fir_addag(){
	ui.box.close();
}
</script>
<div  style="width:787px;height:auto;border:1px solid #f00;margin:20px auto;display:none;" id="tt">

    <br /><br />
 <form method="post" action="{:U('User/reg_do')}" onsubmit="return check();">
    
	<div class="reg_div">
    	<div class="reg_div_1">邮箱：</div>
        <div class="reg_div_2">
        	<input type="text" name="user_name" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<div style="float:left;height:15px;line-height:15px;margin-top:18px;margin-right:3px;" id="rg_user_name_tu"><img  /></div>
        	<span id="rg_user_name">此邮箱为登录账号与找回密码所用邮箱，请认真填写</span>
        </div>
        <div class="clear"></div>
    </div>
    
	<div class="reg_div">
    	<div class="reg_div_1">密码：</div>
        <div class="reg_div_2">
        	<input type="password" name="user_pass" id="user_pass" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<div style="float:left;height:15px;line-height:15px;margin-top:18px;margin-right:3px;" id="rg_user_pass_tu"><img  /></div>
        	<span id="rg_user_pass">请输入不低于6位的英文数字混合的密码</span>
        </div>
        <div class="clear"></div>
    </div>
    
	<div class="reg_div">
    	<div class="reg_div_1">确认密码：</div>
        <div class="reg_div_2">
        	<input type="password" name="user_pass2" id="user_pass2" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<div style="float:left;height:15px;line-height:15px;margin-top:18px;margin-right:3px;" id="rg_user_pass2_tu"><img  /></div>
        	<span id="rg_user_pass2"></span>
        </div>
        <div class="clear"></div>
    </div>
    
	<div class="reg_div">
    	<div class="reg_div_1">昵称：</div>
        <div class="reg_div_2">
        	<input type="text" name="nicheng" id="nicheng" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<div style="float:left;height:15px;line-height:15px;margin-top:18px;margin-right:3px;" id="rg_nicheng_tu"><img  /></div>
        	<span id="rg_nicheng">请输入您的昵称,最大长度7个汉字</span>
        </div>
        <div class="clear"></div>
    </div>

	<div class="reg_div">
    	<div class="reg_div_1">
        	<span>*</span>
            <font>验证码：</font>
        </div>
        <div class="reg_div_2">
        	<input type="text" name="vcode" id="vcode" class="in_input2" onblur="check()"/>
            <img src="__YANZHENG__/vcode.php" onclick="this.src='__YANZHENG__/vcode.php'" name="vdimgck"  align="absmiddle"   id="vdimgck" style="cursor:pointer" class="in_img"/>
            <div class="clear"></div>
        </div>
        <div class="reg_div_3">
        	<div style="float:left;height:15px;line-height:15px;margin-top:18px;margin-right:3px;" id="rg_vcode_tu"><img  /></div>
        	<span id="rg_vcode"></span>
        </div>
        <div class="clear"></div>
    </div>
    <div class="reg_div" style="text-align:center;margin:30px auto;">
    	<div class="reg_div2">
        	<input type="submit" value="注册"/>
        </div>
    </div>
 </form>
</div>
<script>
function check(){

	var user_name=$('input[name="user_name"]').val();
	if(user_name==''){
		
		$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_name').css('color','#f00');
		$('#rg_user_name').html('请输入邮箱');
		return false;
	}
	if(user_name.length<2){
		$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_name').css('color','#f00');
		$('#rg_user_name').html('邮箱长度必须大于2位');
		return false;
	}
	var dsg=false;
	$.ajax({ 
        type: "post", 
        url: "{:U('User/check_user_name')}", 
        async:false, 
		data:'user_name='+user_name+'',
        success: function(v){
			if(v=='1'){
				$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
				$('#rg_user_name').css('color','#f00');
				$('#rg_user_name').html('邮箱已存在');
			}else{
				$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
				$('#rg_user_name').css('color','#0dbe2a');
				$('#rg_user_name').html('邮箱可以使用');
				dsg=true;
			}
        } 
	});
	if(dsg==false){
		return false;	
	}
	var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 
	if(!reg.test(user_name))
    {
		$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_name').css('color','#f00');
		$('#rg_user_name').html('邮箱格式错误');
        return false;
    }else{
		$('#rg_user_name_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
		$('#rg_user_name').css('color','#0dbe2a');
		$('#rg_user_name').html('输入正确');
	}
	
	var user_pass=$('#user_pass').val();
	if(user_pass==''){
		$('#rg_user_pass_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_pass').css('color','#f00');
		$('#rg_user_pass').html('请输入密码');
		return false;
	}
	if(user_pass.length<6){
		$('#rg_user_pass_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_pass').css('color','#f00');
		$('#rg_user_pass').html('密码长度必须大于6位');
		return false;
	}else{
		$('#rg_user_pass_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
		$('#rg_user_pass').css('color','#0dbe2a');
		$('#rg_user_pass').html('输入正确');
	}


	var user_pass2=$('#user_pass2').val();
	if(user_pass2==''){
		$('#rg_user_pass2_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_pass2').css('color','#f00');
		$('#rg_user_pass2').html('请确认密码');
		return false;
	}
	if(user_pass2!=user_pass){
		$('#rg_user_pass2_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_user_pass2').css('color','#f00');
		$('#rg_user_pass2').html('两次密码不一致');
		return false;
	}else{
		$('#rg_user_pass2_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
		$('#rg_user_pass2').css('color','#0dbe2a');
		$('#rg_user_pass2').html('输入正确');
	}

	var nicheng=$('#nicheng').val();
	if(nicheng==''){
		$('#rg_nicheng_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_nicheng').css('color','#f00');
		$('#rg_nicheng').html('请输入昵称');
		return false;
	}
	if(nicheng.length>7){
		$('#rg_nicheng_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_nicheng').css('color','#f00');
		$('#rg_nicheng').html('昵称长度必须小于7位');
		return false;
	}
	var dsg3=false;
	$.ajax({ 
        type: "post", 
        url: "{:U('User/check_nicheng')}", 
        async:false, 
		data:'nicheng='+nicheng+'',
        success: function(v){
			if(v=='1'){
				$('#rg_nicheng_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
				$('#rg_nicheng').css('color','#f00');
				$('#rg_nicheng').html('昵称已存在');
			}else{
				$('#rg_nicheng_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
				$('#rg_nicheng').css('color','#0dbe2a');
				$('#rg_nicheng').html('昵称可以使用');
				dsg3=true;
			}
        } 
	});
	if(dsg3==false){
		return false;	
	}


	var vcode=$('#vcode').val();
	if(vcode==''){
		$('#rg_vcode_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
		$('#rg_vcode').css('color','#f00');
		$('#rg_vcode').html('请输入验证码');
		return false;
	}
	var dsg2=false;
	$.ajax({ 
        type: "post", 
        url: "{:U('User/check_vcode')}", 
        async:false, 
		data:'vcode='+vcode+'',
        success: function(v){
			if(v=='1'){
				$('#rg_vcode_tu img').attr('src','__PUBLIC__/img/chacha.jpg');
				$('#rg_vcode').css('color','#f00');
				$('#rg_vcode').html('验证码错误');
			}else{
				$('#rg_vcode_tu img').attr('src','__PUBLIC__/img/duigou.jpg');
				$('#rg_vcode').css('color','#0dbe2a');
				$('#rg_vcode').html('输入正确');
				dsg2=true;
			}
        } 
	});
	if(dsg2==false){
		return false;	
	}

}
</script>

<div  style="width:787px;height:auto;border:1px solid #f00;margin:20px auto;display:none;" id="tta">

 <form method="post" action="{:U('User/login_do')}">
    
	<div class="reg_div">
    	<div class="reg_div_1">邮箱：</div>
        <div class="reg_div_2">
        	<input type="text" name="user_namea" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<span>请输入注册邮箱登录</span>
        </div>
        <div class="clear"></div>
    </div>
    
	<div class="reg_div">
    	<div class="reg_div_1">密码：</div>
        <div class="reg_div_2">
        	<input type="password" name="user_passa" class="in_input" onblur="check()"/>
        </div>
        <div class="reg_div_3">
        	<span><a href="{:U('User/zhmm')}" style="color:#ccc;font-size:14px;">忘记密码了？</a></span>
        </div>

        <div class="clear"></div>
    </div>
    <div class="reg_div" style="text-align:center;margin:30px auto;">
    	<div class="reg_div2">
        	<input type="submit" value="登录"/>
        </div>
    </div>


 </form>
</div>	
	
	

